soundEngine = { }

soundEngine.PlayMusic = function (name, fadeIn, time)
	if fadeIn == true then
		PlaySound("MUSIC", "music\\" .. name .. ".ogg", true, 1.08, 0, 0)
		FadeInSound("MUSIC", time)
	else
		PlaySound("MUSIC", "music\\" .. name .. ".ogg", true, 1.08, 0, 1)
	end
end

soundEngine.StopMusic = function (fadeOut, time)
	if fadeOut == true then
		FadeOutSound("MUSIC", time)
		AddTimeTrigger(GetCurrentTime() + time, "soundEngine.StopMusicAFTER")
	else
		StopSound("MUSIC")
	end
end

soundEngine.StopMusicAFTER = function ()
	StopSound("MUSIC")
end